import request from '@/utils/request'
import fileRequest from '@/utils/fileRequest';
/**
 * 获取全部列表
 * @param params
 * @returns {*}
 */
export function getList(params) {
  return request({
    url: '/news/getNewsList',
    method: 'GET',
    params
  })
}
/**
 * 根据ID删除
 * @param params
 * @returns {*}
 */
export function deleteNewsApi(params) {
  return request({
    url: '/news/deleteNews',
    method: 'POST',
    params
  })
}


/**
 * @description 获取所有分类
 * @returns {*}
 */
export function getNewsTypeNameApi(){
  return request({
    url: '/news/newsTypeName',
    method: 'GET'
  })
}
/**
 * @description 新增文章
 * @returns {*}
 */
export function insertAndUpdateNewsApi(data){
  return request({
    url: '/news/insertAndUpdateNews',
    method: 'POST',
    data
  })
}

/**
 * @description 查询单个文章
 * @returns {*}
 */
export function getNewsByIdApi(params){
  return request({
    url: '/news/getNewsById',
    method: 'GET',
    params
  })
}


